<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Getting Started</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="ODTONE 0.3">
<link rel="up" href="../dummyserver_index.html" title="Dummyserver">
<link rel="prev" href="../dummyserver_index.html" title="Dummyserver">
<link rel="next" href="../../license.html" title="License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src="../../.././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../dummyserver_index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dummyserver_index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../license.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Getting Started">
<div class="titlepage"><div><div><h4 class="title">
<a name="odtone.app.dummyserver_index.dummyserver_getStart"></a><a class="link" href="dummyserver_getStart.html" title="Getting Started">
        Getting Started</a>
</h4></div></div></div>
<div class="section" title="Extending">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.dummyserver_index.dummyserver_getStart.extending"></a><a class="link" href="dummyserver_getStart.html#odtone.app.dummyserver_index.dummyserver_getStart.extending" title="Extending">Extending</a>
</h5></div></div></div>
<p>
            It is possible to modify the behaviour of the dummyserver when it receives
            a new message. To do this, the "<code class="computeroutput"><span class="keyword">static</span>
            <span class="keyword">void</span> <span class="identifier">process_message</span><span class="special">(</span><span class="identifier">meta_message_ptr</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">)</span></code>" function must be modified.
          </p>
<p>
            E.g.:
          </p>
<p>
            Let's change the dummyserver to send the incomming message to specific
            destination (assuming that the mechanisms for sending messages have already
            been defined):
          </p>
<p>
            
</p>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">process_message</span><span class="special">(</span><span class="identifier">meta_message_ptr</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">)</span>
<span class="special">{</span>
	<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"MIH message: Service="</span> <span class="special">&lt;&lt;</span> <span class="identifier">msg</span><span class="special">-&gt;</span><span class="identifier">sid</span><span class="special">()</span>
		  <span class="special">&lt;&lt;</span> <span class="string">" Opcode="</span> <span class="special">&lt;&lt;</span> <span class="identifier">msg</span><span class="special">-&gt;</span><span class="identifier">opcode</span><span class="special">()</span>
		  <span class="special">&lt;&lt;</span> <span class="string">" Action="</span> <span class="special">&lt;&lt;</span> <span class="identifier">msg</span><span class="special">-&gt;</span><span class="identifier">aid</span><span class="special">()</span>
		  <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>

	<span class="identifier">sap</span><span class="special">.</span><span class="identifier">send</span><span class="special">(</span><span class="identifier">msg</span><span class="special">);</span>
<span class="special">}</span>
</pre>
<p>
          </p>
</div>
<div class="section" title="Running">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.dummyserver_index.dummyserver_getStart.running"></a><a class="link" href="dummyserver_getStart.html#odtone.app.dummyserver_index.dummyserver_getStart.running" title="Running">Running</a>
</h5></div></div></div>
<p>
            Just run dummyserver and wait for incoming messages!
          </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Universidade Aveiro<br>Copyright &#169; 2009 -2011 Instituto de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../dummyserver_index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dummyserver_index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../../license.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
